#!/bin/bash

#Usage ./stop_port.sh $ports

IP=$(ifconfig | grep -A 2 eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')

for PORT in "$@"
do
	redis-cli -h ${IP} -p ${PORT} shutdown nosave
done